set(PROJECT_NAME Client)

cmake_minimum_required(VERSION 3.2)

set(CMAKE_PREFIX_PATH  D:\\Qt\\5.12.3\\msvc2017_64\\lib)
#set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /home/sail/opt/Qt5.7.1/5.7/gcc_64)
#set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /usr/local/Cellar/qt/5.12.0)
#set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /home/jack/Qt5.7.1/5.7/gcc_64)
#
#set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /home/cobot/opt/opencv-3.4.6/build)
#set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} D:\\openCV\\Build)
#set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} D:\\openCV\\Build\\install)
#set(OpenCV_DIR D:\\openCV\\Build\\install\\x64\\vc15\\lib)
#set(${OpenCV_LIBS} D:\\openCV\\Build\\lib\\Debug)
#set(OpenCV_LIBS  D:/openCV/Build/install/x64/vc15/lib/opencv_aruco410d.lib)
# 添加头文件
#include_directories(${OpenCV_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# 貌似如果使用AUTOMOC，需要把Qt5Core这个引用进来。这个find_package是必须的。
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED) # Fuck, 如果要使用autouic那么必须引用这个Qt5Widgets.
find_package(Qt5Network REQUIRED)
#find_package(OpenCV 4 REQUIRED)

get_filename_component(proj_dir_name . NAME_WE)

file(GLOB src_file
        src/*.h
        src/*.cpp
        test/*.h
        test/*.cpp
        common/*.h
        )
SET(GLOB UIS_FILES test/*.ui)
QT5_WRAP_UI(UIS_OUT_H ${UIS_FILES})

add_executable(${PROJECT_NAME} ${src_file})

target_link_libraries(${PROJECT_NAME}
        Qt5::Core Qt5::Widgets  Qt5::Network
#        ${OpenCV_LIBS}
#        ${OpenCL_LIBRARY}
#        ${OpenCV_LIBRARIES}
        )